<template>
    <div>
        <el-cascader
            style="width: 100%;"
            :options="options"
            v-model="value1"
            @change="handleChange"
            filterable
            :props="{value:'label'}"
            placeholder="省/市/区"          
        ></el-cascader>
    </div>
</template>
 
<script>
// 第一步，先下载安装 npm install element-china-area-data -S
// 第二步，如下直接导入
import {regionData} from 'element-china-area-data'
export default {
    name: "cascader",
    props:['value'],
    data(){
        return{
            options:regionData,
            selectedOptions:[]
        }
    },
    mounted(){
        console.log(regionData,'=====regionData===');
        
    },
    computed:{
        value1:{
            set(val){
                this.$emit("input",val)
            },
            get(val){
                return this.value
            }
        }
    },
    methods:{
        handleChange(value){
            this.$emit('provincesValueChang',value)
        }
    }
}
</script>